package org.example.batchutils.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.batchutils.datasource.DataSourceConfig;

import java.util.List;

@Mapper
public interface DataSourceMapper {

    @Select("Select poll_name,url,username,password,driver_class_name from datasource_def where valid_flag = 1")
    public List<DataSourceConfig> getDataSource();

    @Select("Select poll_name,url,username,password,driver_class_name from datasource_def where valid_flag = 1  and poolName= #{poolName}")
    public List<DataSourceConfig> getDataSourceByPollName(String poolName);

    @Select("select poll_name from datasource_def where valid_flag ='1'")
    public List<String> getAllPollName();

}
